package cn.com.clearbus.service.impl;

import cn.com.clearbus.repository.OrderRepository;
import cn.com.clearbus.service.OrderService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderRepository orderRepository;

    @Override
    public int insertOrder() {
        for (int i = 0; i < 20; i++) {
            orderRepository.insertOrder(new BigDecimal(11),11L,"success");
        }
        return 1;
    }

    @Override
    public List<Map> selectOrderbyIds() {
        List<Long> longs = Arrays.asList(new Long[]{
                389184778194124800L, 389184778777133056L,
                389184776457682945L,389184782405206017L
        });
        List<Map> maps = orderRepository.selectOrderbyIds(longs);
        return maps;
    }

    @Override
    public int updateOrderStatus() {
        List<Map> maps = orderRepository.selectOrderbyIds(longs);
    }
}
